﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PasswordManager
{
    public partial class AddFolder : Form
    {
        public string FolderName { get; set; }
        private Point p;
        public AddFolder(Point p)
        {
            InitializeComponent();
            this.p = p;
        }

        private void AddFolder_Load(object sender, EventArgs e)
        {
            this.textBox_folderName.Text = "";
            this.Location = p;
        }

        private void textBox_folderName_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                this.Close();
                this.FolderName = textBox_folderName.Text;
            }
            if (e.KeyData == Keys.Escape)
            {
                this.Close();
                this.FolderName = null;
            }
        }


    }
}
